home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
GameKit
/
Headers
/
gamekit
/
PreferencesBrain.h
< prev
next >
Wrap
Text File
|
1995-06-12
|
4KB
|
117 lines
/* Generated by Interface Builder */
#import <appkit/appkit.h>
#define MAXKEYS 32 // This should be more than enough...
#define MAXVIEW 8 // This should be plenty...
// utility functions to read/write the preferences:
extern BOOL getBOOLPreference(const char *name, BOOL def);
extern int getIntPreference(const char *name, int min, int max, int def);
extern const char *getStringPreference(const char *name, const char *def);
extern void putIntPreference(const char *name, int value);
extern void putBOOLPreference(const char *name, BOOL value);
extern void putStringPreference(const char *name, const char *value);
@interface PreferencesBrain:Object
{
id info;
id levelText;
id levelSlider;
id scorePlayer;
id soundPlayer;
id highScoreTable;
id strings; // localized strings
id speedButtons; // buttons to set game speed on pref panel
id preferencesPanel; // preferences panel instance
id keyMatrix; // matrix showing keys to play game
id musicButtons; // radio buttons for music on/off
id effectButtons; // radio buttons for sound effects on/off
id gameScreen; // GameView instance
id gameBrain; // GameBrain instance
id demoSwitch;
id alertSwitch;
id borderSwitch;
id autoUnPauseSwitch;
id autoStartSwitch;
id thePopUpListButton;
id thePopUpList;
id inspectorBox;
id grayView;
id viewPlayer;
id viewScreen;
id viewSound;
id serverButton;
id serverText;
id defaultPlayerName; // a DAYString
List *ViewsList;
BOOL firstLoad, unfair;
NXRect inspectFrame, view[MAXVIEW];
// instance variables to hold preferences and game status:
int speed, level, numKeys;
BOOL music, effects, alert, demoSound, border, autoUnPause,
autoStart, useServer;
char *keys[MAXKEYS], *defkey[MAXKEYS], *version, *serverName;
}
- init; // designated initializer
- appDidInit:sender; // forwarded by GameBrain
- (BOOL)border; // return YES if gray border is on
- (int)startLevel; // returns starting level
- (int)speed;
- (BOOL)effects;
- (BOOL)music;
- (BOOL)alert;
- (BOOL)autoUnPause;
- (BOOL)autoStart;
- (BOOL)demoSound;
- (BOOL)useServer;
- setUseServer:(BOOL)useIt;
- setAlert:(BOOL)al;
- setAutoUnPause:(BOOL)al;
- setAutoStart:(BOOL)al;
- (const char *)serverName;
- setNumKeys:(int)num;
- readDefaults:sender; // get preferences from defaults database
- writeDefaults:sender; // save preferences in defaults database
- (BOOL)firstTimeCheck; // first time running this version?
- revert:sender; // return to default values
- takeKey:sender; // used by below (keyChange) to get new keys
- (char)keyVal:(int)keyIndex; // returns default key for action (0-4)
- keyChange:sender; // accept changes in keys
- speedChange:sender; // accept changes in speed
- findKeyFor:sender; // used by below to set keys in pref. matrix
- setUpViews;
- preferences:sender; // sets controls on pref panel & brings it up
- refresh; // refresh all controls
- free;
- addView:(id)aView withName:(const char *)name;
- show:(const char *)name;
- toggleInspectorPanels:sender;
- turnOnView:(int)i;
- preferencesPanel; // return the preferencesPanel, load if needed.
- musicChange:sender; // turn music on/off
- setScore:sender;
- effectsChange:sender; // turn sound effects on/off
- setDefaultPlayerName:(const char *)aString; // change default player name
- (const char *)defaultPlayerName; // return ptr to defaultPlayerName string
- changeLevel:sender;
- alertChange:sender;
- unPauseChange:sender;
- autoStartChange:sender;
- demoSoundChange:sender; // **New turn off sound only in demo
- setBack:sender; // set the background image
- revertBack:sender; // revert to default background image
- (BOOL)borderOn;
- setBorder:(BOOL)newBord;
- borderChange:sender;
- changeServer:sender;
- (BOOL)unfair;
- setUnfair;
- startingGame; // reset the unfair variable
@end